<template>
	<view class="my-container">
		<list-item v-if="list.length" :applyList="list"></list-item>
		<view v-else>
			<van-empty description="暂无物料"></van-empty>
		</view>
	</view>
</template>

<script>
	import ListItem from '../components/listItem.vue'
	export default {
		components: {
			ListItem
		},
		data() {
			return {
				params: {
					人员id: null,
					pagination: {
						current: 1,
						pageSize: 10
					},
					sorter: {
						field: "id",
						order: 0
					}
				},
				list: []
			}
		},
		onLoad() {
			this.params.人员id = uni.getStorageSync('userInfo').id
			this.getMyMaterial()
		},
		methods: {
			getMyMaterial() {
				uni.showLoading()
				this.$http.post('/property/workerStuffRecord/list', this.params).then(res => {
					if(res.code === 10000) {
						// console.log(res)
						this.list = res.data.list || []
					}
				})
			}
		}
	}
</script>

<style lang="scss" scoped> 
.my-container {
	// background-color: #f5f5f5;
	// min-height: 100vh;
}
</style>
